
#size=262144
size=32768
blk=(1 2 4 8 16 32 64 128 256 512 1024 2048 4096)



make clean
make dag
file=temp.log
result_file=result.log
#for((j=0;j<5;j++))
#do
  for((i=0;i<13;i++))
  do
    bsub -I -b -q q_sw_expr -n 1 -cgsp 64 -host_stack 1024 -share_size 6000 -o $file ./04.dot_product_acemesh $size ${blk[$i]} 5
    #sh -x run.sh $size ${blk[$i]} 5 >> $file
  done
  #echo $size_${blk[$i]} >> result.log
  #grep -n "time (ms)" $1_${size}_temp.log | awk '{print $9}' >> result.log
  echo total_graph_build >> $result_file
  grep -n "total_graph_build" $file | awk {'print $2'} >> $result_file

  echo total_graph_exec >> $result_file
  grep -n "total_graph_exec" $file | awk {'print $2'} >> $result_file

  echo total_time >> $result_file
  grep -n "total_time" $file | awk {'print $2'} >> $result_file
  
  echo mutex_file >> $result_file
  grep -n "ain core mutex fa" ./$file | awk '{print $6}' >> $result_file
  echo total_mutex >> $result_file
  grep -n "re mutex success co" ./$file| awk '{print $6}' >> $result_file

#done

cat $result_file

mv $file $1_$file
mv $result_file $1_${result_file}
